|
JIRA 4.4 : Integrating JIRA with Apache
This page last changed on Jun 23, 2011 by ggaskell.
This page describes how to integrate an Apache HTTP Server (httpd) with JIRA (via mod_proxy), such that 'httpd' forwards requests on to JIRA and responses back to the user. This is useful if you already have 'httpd' serving web pages on port 80 (e.g. http://mycompany.com), and wish to integrate JIRA as just another URL (eg. http://mycompany.com/jira).
Step 1: Configure JIRA's application serverHere we assume you are using the JIRA Standalone distribution, which comes with Tomcat. First, we need to edit Tomcat's conf/server.xml file, and set the context path: <Server port="8005" shutdown="SHUTDOWN">
<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false">
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
....
Here we have set the context path to /jira, assuming JIRA will be running on http://mycompany.com/jira/. Restart Tomcat, and ensure you can still access JIRA normally (eg. at http://localhost:8080/jira/). Note: if you want Tomcat responsible for all URLs, specify a blank context path with path="" -- not path="/" . Turn JIRA's GZip compression OFF (since there will be no benefit from GZip compression once proxying is implemented, and in fact GZIP has been reported to cause performance problems in this situation). Step 2: Configure 'httpd'Assuming an Apache HTTP Server version 2 installation, the following needs to be done: Enable mod_proxy and mod_proxy_httpThe exact steps will be specific to your operating system. Refer to the Apache documentation for your operating system. On Debian/Ubuntu it is done as follows: teacup:/etc/apache2# a2enmod proxy_http Enabling proxy as a dependency Module proxy installed; run /etc/init.d/apache2 force-reload to enable. Module proxy_http installed; run /etc/init.d/apache2 force-reload to enable. teacup:/etc/apache2# Configure mod_proxyHere we create a config snippet for JIRA, in sites-available/jira-mod_proxy: teacup:/etc/apache2# cd sites-available teacup:/etc/apache2/sites-available# cat > jira-mod_proxy <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserveHost On ProxyPass /jira http://localhost:8080/jira ProxyPassReverse /jira http://localhost:8080/jira teacup:/etc/apache2/sites-available# teacup:/etc/apache2/sites-available# a2ensite jira-mod_proxy Site jira-mod_proxy installed; run /etc/init.d/apache2 reload to enable. teacup:/etc/apache2/sites-available# /etc/init.d/apache2 reload Reloading apache 2.0 configuration.... teacup:/etc/apache2/sites-available# JIRA should now be integrated with 'httpd'. You should be able to view JIRA at http://localhost/jira (i.e. on port 80). Terminating an SSL connection at 'httpd'To add an SSL connection that terminates at 'httpd', using HTTP to connect to JIRA behind it, most of the relevant configuration is: Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
Notes:
ProxyPreserveHost is only available on Apache HTTP Server version 2. For versions 1.1-1.3.x, you should instead specify proxyName and proxyPort attributes in Tomcat as follows: <Server port="8005" shutdown="SHUTDOWN">
<Service name="Catalina">
<Connector port="8080"
maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"
proxyName="mycompany.com" proxyPort="80" />
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false">
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
....
If you are using Apache HTTP Server version 1.x, make sure you don't use caching (CacheRoot directive).
Troubleshooting
See Also
|
| Document generated by Confluence on Aug 18, 2011 23:27 |